<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>iComet forever-iframe demo</title>
</head>
<body>

<pre style="height:200px; width: 600px; border: 1px solid #999; overflow: auto; background: #eee; padding: 8px;">
## How to Use?

1. start icomet-server

2. assuming you are running nginx listening on port 8080, if not,
you will have to modify "8080" in this file to the exact port number,
configure your nginx.conf, add the lines below and restart:

location ~ ^/icomet/.* {
	rewrite ^/icomet/(.*) /$1 break;

	proxy_buffering off;
	proxy_read_timeout 60;
	proxy_connect_timeout 60;
	proxy_pass   http://127.0.0.1:8100;
}

3. navigate your web browser to http://127.0.0.1:8080/web/long-polling.html
or http://127.0.0.1:8080/web/forever-iframe.html

4. open a command line terminal, execute

curl "http://127.0.0.1:8000/pub?cname=a&content=hello"
</pre>

<script>
try{
	document.domain = window.location.hostname.split('.').slice(-2).join('.');
}catch(e){};

var count = 0;
function icomet_cb(msg){
	if(msg.type != 'data'){
		return;
	}
	count ++;
	var output = document.getElementById('output');
	var time = '' + (new Date());
	output.innerHTML += count + '. ' + time + ': ' + msg.content + '<br/>';
}
</script>
	
	<h3>Server push messages:</h3>
	<div id="output"></div>

	<iframe src="http://127.0.0.1:8080/icomet/iframe?cname=a" height="0" width="0" border="0" style="border:none;"></iframe>

</body>
</html>
